package com.xl.shiro_demo.handler;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.naming.AuthenticationException;

@ControllerAdvice
@Slf4j
public class MyExceptionHandler {

    @ResponseBody
    @ExceptionHandler(AuthenticationException.class)
    public String ErrorHandler(AuthenticationException e){
        log.error("没有通过权限验证!",e);
        return "没有通过权限验证!";
    }
}
